﻿using KingsSharp.Common;
using KingsSharp.Common.Data;
using KingsSharp.Core;
using KingsSharp.Core.Data;
using CRM.Admin.Contracts.Contract.Logs;
using CRM.Admin.Contracts.Dto.Logs;
using CRM.Admin.Contracts.Model.Logs;
using System;
using System.Linq;

namespace CRM.Admin.Services.Service.Logs
{
    /// <summary>
    /// 业务日志
    /// </summary>
    public class BusinessLogService:ServiceBase, IBusinessLogService
    {
        private IRepository<BusinessLog,Guid> BusinessLogRepository { get; set; }

        public BusinessLogService(IRepository<BusinessLog, Guid> _BusinessLogRepository)
            :base(_BusinessLogRepository.UnitOfWork)
        {
            BusinessLogRepository = _BusinessLogRepository;
        }
        public IQueryable<BusinessLog> ItemBusinessLog
        {
            get
            {
                return BusinessLogRepository.Entities;
            }
        }
        public OperationResult InsertBusinessLog(params BusinessLogDto[] dtos)
        {
            dtos.CheckNotNull("dtos");
            var result = BusinessLogRepository.Insert(dtos);
            return result;
        }
    }
}
